//
//  ViewController.m
//  Runtime给Model赋值
//
//  Created by MyMac on 15/8/11.
//  Copyright (c) 2015年 MyMac. All rights reserved.
//

#import "ViewController.h"
#import "BeautifulGirlModel.h"
#import "BoyModel.h"
#import "NSObject+name.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSMutableDictionary*data=[[NSMutableDictionary alloc]initWithCapacity:11];
    for (NSUInteger i=0; i<=10; i++) {
        NSString*key=[NSString stringWithFormat:@"girl%ld",(long)i];
        NSString*value=[NSString stringWithFormat:@"我是第%ld个女孩",(long)i];
        [data setValue:value forKey:key];
        
    }
    UIPageControl *niu = [[UIPageControl alloc]init];
    [niu setValue:[UIImage imageNamed:@""] forKeyPath:@"pageImage"];
    
    BeautifulGirlModel*model1=[BeautifulGirlModel modelWithDictionary:data];
    BeautifulGirlModel*model2=[[BeautifulGirlModel alloc]initWithDictionary:data];
    NSLog(@"%@^^^^%@^^",model1,model2);
    
    
        NSMutableDictionary*data1=[[NSMutableDictionary alloc]initWithCapacity:11];
        for (NSUInteger i=0; i<=8; i++) {
            NSString*key=[NSString stringWithFormat:@"keyBoy%ld",(long)(i+1)];
            NSString*value=[NSString stringWithFormat:@"我是第%ld个👦",(long)(i+1)];
            [data1 setValue:value forKey:key];
    
        }
        BoyModel*model3=[[BoyModel alloc]initWithDictionary:data1];
        NSLog(@"%@^^^",model3);
    
    
#pragma -mark 分类中添加属性
    self.name=@"分类添加属性";
    NSLog(@"%@",self.name);
    
    
    
    self.categoryView=[[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
    self.categoryView.backgroundColor=[UIColor redColor];
    [self.view addSubview:self.categoryView];
    NSLog(@"%@",self.name);
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
